/*
 * Ground.h
 *
 *  Created on: 15/06/2013
 *      Author: gabriel
 */

#ifndef GROUND_H_
#define GROUND_H_


#ifdef MacOSX
#include "GLee.h"
#include <GLUT/glut.h>
#else
#include "GLee.h"
#include <GL/glut.h>
#endif

#include "shader.h"
#include "matrix4f.h"
#include "objLoader.h"
#include "tgaimage.h"

#define VALS_PER_VERT 3
#define VALS_PER_COLOUR 4
#define VALS_PER_INDEX 4		// The number of vertices in our square, used for array size and in rendering
#define VALS_PER_TEX 2          // number of dimensions of the texture data (if image, set it to 2)
#define NUM_SQUARES 1      // number of squares in a cube
#define NUM_VERTICES 4


class Ground {
public:

	std::string filename;
	Shader *shader;
	unsigned int textureHandle;
	unsigned int vaoHandle;
	Matrix4f matrix;

	float *vertices;
	float *colours;
	unsigned int *indices;
	float *texCoord;

	Ground();
	Ground(std::string filename, Shader *program);
	void setup();
	void render();
	void loadData();
	unsigned int createVAO();
	unsigned int loadTexture(std::string filename);
	void setMatrix(Matrix4f &matrix);
	virtual ~Ground();
};

#endif /* GROUND_H_ */
